// 导入 axios
import axios from '@/utils/request.js'
// import store from '@/store/index.js'

// export default 123

// 1.获取登录用户的频道---------------------------------
export const getUserChannels = (mobile, code) => {
  return axios({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}

// 2.获取所有频道---------------------------------
export const getAllChannels = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels'
  })
}

// 3.新增单个频道-------------------------------------
export const addChannel = (id, seq) => {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [{ id, seq }]
    }
  })
}

// 4.删除单个频道-------------------------------------
export const deleteUserChannel = (id) => {
  return axios({
    method: 'delete',
    url: `/v1_0/user/channels/${id}`
  })
}
